package com.cy.springcloudalibaba.transaction.consumer;

import com.cy.springcloudalibaba.sink.MySink;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Service;

/**
 * @Description: 接收消息
 * @ClassName: ReceiverService
 * @Author: chenyu
 * @Date: 2025/3/3 16:32
 */
@Service
public class ReceiverService {
    /**
     *  第二种接收消息方式，通过注解监听接收
     * @param msg 消息体
     */
    @StreamListener(value = MySink.INPUT)
    public void receive(String msg) {
        System.out.println(msg);
    }
}
